Skip to content

refactor(core)!: retire 42 zero-consumer entry exports - #30708

Merged
objectstack-fleet[bot] merged 3 commits into
mainfrom
claude/project-thread-qiuydy
Nov 5, 2026
Merged

objectstack-fleet[bot] merged 3 commits into
mainfrom
claude/project-thread-qiuydy

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Requested by Sales · project thread

Part of #25921. The umbrella stays open; this is barrel batch 5, claim 6670047779 (seat domain:ui#6, batch amendment from the seat after the census). Earlier batches: #30541, #30576, #30629, #30650.

Clause-②: no (narrowing)
Metadata-protocol: none

维护者速读

  • 改了什么:@object-ui/core 的包入口不再导出 42 个名字,其中 buildQueryAST 与它包装的 defaultQueryASTBuilder 连同代码一起删掉,其余 40 个只离开入口、模块照旧。
  • 为什么改:这 42 个名字在仓内(包外,含测试与文档)与 hotcrm 均零引用,README 未教,也不被保留导出的签名用到;被删的 2 个在包内也零读者,是死代码。本卡逐包收窄无人使用的公开导出。
  • 风险与回滚:对外是 breaking 收窄,只影响直接从包入口 import 这些名字的外部宿主;控制台与所有 @object-ui/* 包不受影响。入口与内部子 barrel 的 export * 改成了具名列表,反向探针证明其余 476 个名字一个不少。回滚即 revert 本 PR。
  • 先看:ui/packages/core/src/index.ts(11 处 export * 改具名列表,漏列即丢活名)、ui/packages/core/src/actions/index.ts 与 evaluator/index.ts(子 barrel 同类改写)、.changeset/25921-core-zero-consumer-exports.md(迁移说明)。
  • 两分钟验证:git grep -l -w -e buildQueryAST -e defaultQueryASTBuilder -e KNOWN_ACTION_KEYS -e isDebugEnabled -- ':!ui/packages/core' ':!**/CHANGELOG.md' 应只命中本 PR 的 changeset。
  • 需要你做的:无,席位落地。

What changes

  • @object-ui/core, deleted (nothing inside the package read them either): buildQueryAST and the defaultQueryASTBuilder instance it wrapped, from src/query/query-ast.ts. Both were re-grepped on the new head: the only hits left are this PR's changeset.
  • @object-ui/core, off the entry only (each module keeps its in-package readers):
    • utils/column-identity: CANONICAL_COLUMN_IDENTITY_KEY, LEGACY_COLUMN_IDENTITY_KEYS, normalizeColumnIdentities, CANONICAL_COLUMN_LABEL_KEY (dropped from the existing named list);
    • utils/dom-props: isOpenDomAttributeFamily; utils/affordanceGrants: type AffordanceGrantRow; utils/column-sortability: normalizeObjectSortability, OBJECT_SORTABILITY_KEY; utils/action-activation: ACTION_SWITCHED_OFF_KEY; utils/cascade-delete-objects: CASCADE_DELETE_OBJECTS_KEY; utils/sort-values: compareCellValues; errors/index: isErrorCode, formatErrorMessage; utils/debug: isDebugEnabled; utils/filter-tokens: type ContextTokenName; utils/chart-series: isBuiltinAggregate, resolveMeasureLabel, resolveRelationshipTarget, resolveDimensionFieldOptions, INTEGER_AGGREGATES; utils/record-color: isColorLiteral, buildFieldColorMap, type FieldColorOption. Those eleven export * lines in src/index.ts become named lists of their kept exports;
    • through the unpublished sub-barrels (exports has only .): evaluator/index.ts (SUBJECT_PERMISSIONS, SUBJECT_CAPABILITIES, ROW_PREDICATE_CANONICAL_ROOT; two export * lines become named lists), actions/index.ts (NAVIGATION_ALIAS_KEYS, HOST_DISPATCH_ACTION_KEYS, KNOWN_ACTION_KEYS, classifyActionKeys, hasDeprecatedObjectParams, warnOnDeprecatedObjectParams leave the actionKeys list; isLegacyActionEnvelope, actionCopyText, fillTransitionalCopy leave two export * lines turned named), theme/index.ts (toCSSColor, generateTypographyVars, generateBorderRadiusVars, generateShadowVars), data-scope/index.ts (isElementDataSourceBlock).
  • Named lists were built from the TypeScript checker's export list. The first cut missed five names two modules re-export from @objectstack/spec (CONTEXT_TOKENS through utils/filter-tokens; FIELD_UNSORTABLE_VIRTUAL_TYPE, FIELD_SORTABLE_UNPROVISIONED_ANCHOR, FieldSortability, ObjectSortability through utils/column-sortability); the reverse probe caught them and the second commit puts them back.
  • One test moves: evaluator/__tests__/rowPredicateCanon.test.ts imported ROW_PREDICATE_CANONICAL_ROOT from the evaluator barrel; it now imports the module and asserts the constant is off the barrel, beside the detector that stays.
  • One new changeset, .changeset/25921-core-zero-consumer-exports.md: patch level, ! title, BREAKING paragraph that says which names are gone from the package and which only left the entry, FROM/TO lines for every retired name, ADR-0087 marker not-required (runtime-export-retired …) naming all 42 operands.

Why

Card #25921 narrows ui/packages barrels to names someone imports. The checker export list after this PR is exactly the census list minus these 42 (518 to 476), nothing added.

Tests

Census on origin/main 66a8822 with the method of batches 1 to 4: entry export names from the TypeScript checker over the built dist/index.d.ts; per name git grep -l -w -F outside the package, minus **/CHANGELOG.md, pnpm-lock.yaml and .changeset/** (test files and prose count), each zero re-run one name at a time; the package *.md and demo/; keep rule 3 (reached from a kept export's emitted declaration, walked through non-exported local declarations too, to a fixpoint); hotcrm 6961ab1. Full table: project file issue-25921-seat6/census-b5.md.

Package Entry names Zero outside hits Kept (README, rule 3, or seat ruling) Retired
@object-ui/core 518 116 74 (2 README, 67 rule 3, 5 by seat ruling) 42

Kept by seat ruling, zero hits notwithstanding: defaultObjectValidationEngine (validation/validators/index.ts states the deprecated engine stays exported for host applications), and SchemaError, RegistryError, ExpressionError, PluginError (returned by the kept createError; a caller needs them for instanceof).

Controls (outside hits, same module as the retired names): toDomProps 111, columnIdentity 36, buildChartSeries 34, resolveAffordance 33, elementDataSourceBlock 37, resolveFilterPlaceholders 40, isActionSwitchedOff 15, FieldValidationError 11, attachObjectSortability 8, getSortValue 6, interpretActionResponse 6, createFieldColorResolver 6, RETIRED_ACTION_KEYS 5, actionCopySource 4, QueryASTBuilder 3, subjectPermissionsOf 3, detectNonCanonicalRowSpelling 3, parseDebugFlags 3, attachCascadeDeleteObjects 3, hexToHSL 2; hotcrm imports no @object-ui/core code but names it in prose (ActionRunner 2 files).

Readings at dea2c4b (branch head after merging origin/main a2437b5; the same set first ran green at c21d361 before the merge):

Build, type-check, package tests
  • turbo run build --filter=@object-ui/console... --filter='./packages/**' --filter='@objectstack/dogfood^...': 113 of 113 successful, under os-verify-lock, VERDICT command-exit 0.
  • pnpm --filter @object-ui/core type-check (tsc --noEmit && tsc -p tsconfig.test.json): exit 0.
  • pnpm --filter @object-ui/core test: Test Files 233 passed (233), Tests 4376 passed, 27 skipped (4403), exit 0.
Reverse check over every former entry name

A temporary app-shell probe re-exporting ALL 518 base entry names of @object-ui/core (types as type), tsc --noEmit in ui/packages/app-shell against the rebuilt dist/index.d.ts: exactly 42 errors (TS2305 27, TS2724 15, all in the probe), and the set of names they name is identical (diff) to the 42 retired names; the other 476 resolve. On the first cut the probe answered 47: it caught the five spec re-exports the named lists had dropped, fixed in the second commit. Probe deleted; git status clean.

Gates
  • node scripts/pm/dispatch-gates.mjs --commands: 35 derived families, each run with its exit code captured before any pipe, all exit 0 (among them check-adr-0087-registration --base origin/main, check-changeset-no-major, check-empty-changeset, check-closing-keyword-parity, check-comment-mask-corpus, check-sdui-manifest, check:published-files, check:type-check-coverage, check:type-check-debt, check:undeclared-dep-imports, and vitest run scripts/ in ui/: Test Files 170 passed, 2 skipped (172), Tests 4970 passed, 2 skipped (4972)).
  • dispatch-gates --ran: 35 derived, 35 run, 0 NOT-MEASURED (a derived zero: all 35 recorded an exit code).
  • node scripts/check-platform-checklist.mjs --changed-from origin/main: exit 0, 0 anchored files in the change set.
Dogfood (narrowing arm)

pnpm --filter @objectstack/dogfood test under os-verify-lock on dea2c4b: VERDICT command-exit 0; Test Files 421 passed, 3 skipped (424); Tests 3513 passed, 36 skipped (3549); no failures.

Deleted names re-grepped on dea2c4b: buildQueryAST and defaultQueryASTBuilder appear only in this PR's changeset. No ablation: export lines and two dead declarations only.

Acceptance notes

  • Nothing outside the card's surface was found.

Verification

Reviewer: git grep -l -w -e buildQueryAST -e defaultQueryASTBuilder -- ':!**/CHANGELOG.md' answers only this PR's changeset; the CI Type Check UI lane compiles every @object-ui/* consumer against the narrowed entry.


Generated by Claude Code

The @object-ui/core entry stops exporting 42 names nothing outside the
package imports (tests and prose counted, hotcrm included). buildQueryAST
and defaultQueryASTBuilder had no reader inside the package either and
are deleted; the other 40 stay in their modules and only leave the entry.
The export-star lines over those modules become named lists, in the
entry and in the unpublished evaluator, actions, theme and data-scope
sub-barrels.

Claude-Session: https://claude.ai/code/session_01L6bhgXepjCvAfm5dmHYdrX
Co-authored-by: Claude <noreply@anthropic.com>
…ty modules re-export on the entry

The reverse probe over all 518 former entry names caught five names the
named lists dropped: CONTEXT_TOKENS, FIELD_UNSORTABLE_VIRTUAL_TYPE,
FIELD_SORTABLE_UNPROVISIONED_ANCHOR, FieldSortability and
ObjectSortability, which those modules re-export from @objectstack/spec.

Claude-Session: https://claude.ai/code/session_01L6bhgXepjCvAfm5dmHYdrX
Co-authored-by: Claude <noreply@anthropic.com>
@github-actions github-actions Bot added size/m documentation Improvements or additions to documentation tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface labels Nov 5, 2026
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:ui#6 · os-sales · session_01L6bhgUR8Nu4M7tbtgES7q2

维护者速读

席位核对 — ACCEPT · head dea2c4b

  • 形态:8 文件 +238/−39(入口与四个未发布的子 barrel、query/query-ast.ts 删两个名字、一份测试改从模块引、一份 changeset)。check-governed-merges --pr 30708:NOT governed,277 行 ≤ 3000。Part of #25921,draft,目标 main,merge-tree 对 main 干净。批次与认领 6670047779 及其批次修订一致;36 个 open PR 都没碰这些 barrel 和 query-ast。
  • 契约(收窄,契约复核档):Clause-② no (narrowing),Metadata-protocol none。席位在 head 上独立复核:42 个退役名在 ui/packages/core 之外(排除 CHANGELOG 与 .changeset)全部 0 处;删掉的两个名字在分支 ui/ 下除 changeset 外 0 处。具名列表由 dev 的反向探针兜底:探针覆盖全部 518 个旧入口名,恰好 42 个报错,名单与退役集一致,其余 476 个都能解析。首版漏了 5 个经模块转导出的 spec 名,探针抓到后第二个提交已补回。保留项照修订:defaultObjectValidationEngine,以及 SchemaError、RegistryError、ExpressionError、PluginError(保留的 createError 返回它们)。changeset 带 ! 标题、BREAKING 段、FROM/TO 与 runtime-export-retired 的 ADR-0087 标记。收窄没有未列明的使用方,席位接受。
  • 前提实测:dev 报告 6671689557,读数都在 dea2c4b 上:闭包构建 113/113,core 测试 233 个文件全过,派生门禁 35/35 exit 0,dogfood 424 个文件中 421 过、3 跳过。
  • 门禁 check-runs:head 上 55 个,44 success,11 skipped,0 红。
  • 接受的偏差:① 具名列表让这些模块以后新增的导出不会再自动进入入口,这是有意收紧。② PR 归属块链接卡线程,与前几批一致。
  • 范围外去向:components(约 65 个 shadcn 子部件)等其余包留在 retire the zero-consumer surface: nine dead modules (2,211 LOC), plugin-ai, runner's publish flag, test-only reset helpers on public barrels, the providers trio, 122 dead i18n keys, root orphans #25921;子路径入口等 check-adr-0087(runtime-export-retired): the operand names only a package's root entry, so a retired SUBPATH export (./locales/zh → ./locales/zh-Hans) can only be held as no-migration-prescription #30598。落地时写进 Release,卡回 pm:queue。
  • 落地条款:中继 pr_ready + automerge_enable。合并后卡不关(Part of),席位一并摘掉 pm:dispatched、换回 pm:queue、取消指派,并留 Release 评论。

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review November 5, 2026 23:13
@objectstack-fleet
objectstack-fleet Bot enabled auto-merge November 5, 2026 23:13
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 5, 2026
Merged via the queue into main with commit 4261169 Nov 5, 2026
56 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/project-thread-qiuydy branch November 5, 2026 23:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation size/m tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant